package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.jinzecloud.reportapproval.bean.ProCoveredModel;
import com.jinzecloud.reportapproval.dto.Param;
import com.jinzecloud.reportapproval.service.ProCoveredModelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;


/**
 * 涵盖机型（或同单元机型）样机技术规格
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-09-03 12:10:44
 */
@RestController
@RequestMapping("reportApproval/procoveredmodel")
@Api(tags = "涵盖机型（或同单元机型）样机技术规格", description = "涵盖机型（或同单元机型）样机技术规格", value = "涵盖机型（或同单元机型）样机技术规格")
public class ProCoveredModelController {
    @Autowired
    private ProCoveredModelService proCoveredModelService;

    /**
     * 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样机技术规格列表",notes = "涵盖机型（或同单元机型）样机技术规格列表")
    //@RequiresPermissions("reportApproval:procoveredmodel:list")
    public R list(@RequestBody Param param){
        PageUtils page = proCoveredModelService.queryPage(param);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping(value = "/info/{id}",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样机技术规格信息",notes = "涵盖机型（或同单元机型）样机技术规格信息")
    //@RequiresPermissions("reportApproval:procoveredmodel:info")
    public R info(@PathVariable("id") Integer id){
		ProCoveredModel proCoveredModel = proCoveredModelService.getById(id);

        return R.ok().put("proCoveredModel", proCoveredModel);
    }

    /**
     * 保存
     */
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样机技术规格保存",notes = "涵盖机型（或同单元机型）样机技术规格保存")
    //@RequiresPermissions("reportApproval:procoveredmodel:save")
    public R save(@RequestBody ProCoveredModel proCoveredModel){
		proCoveredModelService.save(proCoveredModel);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样机技术规格修改",notes = "涵盖机型（或同单元机型）样机技术规格修改")
    //@RequiresPermissions("reportApproval:procoveredmodel:update")
    public R update(@RequestBody ProCoveredModel proCoveredModel){
		proCoveredModelService.updateById(proCoveredModel);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    @ApiOperation(value = "涵盖机型（或同单元机型）样机技术规格删除",notes = "涵盖机型（或同单元机型）样机技术规格删除")
    //@RequiresPermissions("reportApproval:procoveredmodel:delete")
    public R delete(@RequestBody Integer[] ids){
		proCoveredModelService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
